<template>
  <a-card :bordered="false" class="card-area">
    <!-- 查询区域 11111-->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" :label-col="labelCol" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="8" :sm="8">
            <a-form-item label="手机">
              <a-input placeholder="请输入手机" v-model="queryParam.phone"></a-input>
            </a-form-item>
          </a-col>
          <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
           <a-col :md="6" :sm="24">
               <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
               <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
           </a-col>
        </span>
        </a-row>
      </a-form>
    </div>

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增会员</a-button>
    </div>

    <!-- table区域-begin -->
    <div>
      <!--      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
      <!--        <i class="anticon anticon-info-circle ant-alert-icon"></i>-->
      <!--        <span>已选择</span>-->
      <!--        <a style="font-weight: 600">-->
      <!--          {{ selectedRowKeys.length }}-->
      <!--        </a>-->
      <!--        <span>项</span>-->
      <!--        <a style="margin-left: 24px" @click="onClearSelected">清空</a>-->
      <!--      </div>-->

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">

       <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>
        </span>
      </a-table>
    </div>
    <!-- table区域-end -->
    <ord-store-member-modal ref="modalForm" @ok="modalFormOk"></ord-store-member-modal>
  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { putAction, getAction, postAction } from '@/api/manage'
import { frozenBatch } from '@/api/api'
import OrdStoreMemberModal from './modules/OrdStoreMemberModal'

export default {
  name: 'ord_store_memberList',
  mixins: [JeecgListMixin],
  components: {
    OrdStoreMemberModal
  },
  data() {
    return {
      description: '餐饮会员信息管理页面',
      labelCol: { style: { width: '70px' } },
      // 表头
      columns: [
        {
          title: '会员名称',
          align: 'center',
          dataIndex: 'name'
        },

        {
          title: '性别',
          align: 'center',
          dataIndex: 'sex',
          customRender: function(t, r, index) {
            if (t == '2') {
              return '男'
            } else if (t == '1') {
              return '女'
            }
            return '未知'
          }
        },
        {
          title: '生日日期',
          align: 'center',
          dataIndex: 'birthday'
        },
        {
          title: '会员等级',
          align: 'center',
          dataIndex: 'name'
        },
        {
          title: '余额',
          align: 'center',
          dataIndex: 'balance'
        },
        {
          title: '积分',
          align: 'center',
          dataIndex: 'points'
        },
        {
          title: '手机',
          align: 'center',
          dataIndex: 'phone'
        },
        {
          title: '注册来源',
          align: 'center',
          dataIndex: 'regSource',
          customRender: function(t, r, index) {
            if (t == '0') {
              return '线下'
            }
            return '线上'
          }
        },
        {
          title: '注册时间',
          align: 'center',
          dataIndex: 'createTime'
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/store/member/list',
      },
      storeList: []
    }
  },
  created() {
    const that = this
  },
  methods: {}
}
</script>
<style scoped>
</style>
